/*
 * @Author: fubobo
 * @Date: 2025-07-16 10:10:52
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2025-07-22 09:41:06
 * @Description: http类型定义or拓展
 */

export type MethodType =
  | "GET"
  | "POST"
  | "PUT"
  | "DELETE"
  | "OPTIONS"
  | "HEAD"
  | "CONNECT"
  | "TRACE";

// 拓展uniapp请求参数类型
export interface RequestConfig extends UniApp.RequestOptions {
  query?: Record<string, string | number | boolean>;
  /** 是否显示加载提示 */
  showLoading?: boolean;
  /** 加载提示文本 */
  loadingText?: string;
  /** 是否需要身份验证 (默认为 true) */
  requireAuth?: boolean;
  /** 是否需要默认错误弹窗 */
  isShowErrorToast?: boolean;
}

/**
 * 统一响应结构
 * 定义后端返回的标准数据结构
 */
export interface IResData<T> {
  code: number;
  msg: string;
  data?: T;
}
